package com.lebang.model.enums;


public enum InviteEnum {
    /**
     * 是否毕业
     */
    GRADUATION("已毕业", 1),
    UN_GRADUATION("未毕业", 0),

    /**
     * 师徒版本
     */
    OLD_VERSION("旧版本",1),
    NEW_VERSION("新版本",2),

    /**
     * 师徒任务
     */
    NEW_TASK("新手阶段任务",1),
    FIRST_CASH("第一次提现",2),


    /**
     * 徒弟提醒类型
     */
    NEW_TASK_REMIND("新手阶段任务提醒",1),
    FIRST_CASH_REMIND("第一次提现提醒",2),
    INVITE_REMIND("收徒提醒",3),
    ALREADY_REMIND("已经提醒",4),

    /**
     * 师徒邀请字典
     */
    invite_new_task_award("新手任务阶段任务",1),
    invite_first_cash_award("首次提现任务",2),
    max_invite_everyday("每日最大邀请数",3),
    new_invite_fuzi("邀请复制信息",4),
    new_invite_copy_address("邀请复制地址",5),
    new_invite_pack_address("下载包地址",6),
    release_expire_time("师徒关联过期时间",7),
    invite_code_expire_time("邀请链接过期时间",8),

    /**
     * 1小时内相同ip过多
     */
    invite_ip_hour_five("1小时5次最多ip",5),

    /**
     * 刷机root
     */
    NOT_ROOT("没刷机",0),
    IS_ROOT("有刷机",1),

    /**
     * 徒弟提醒类型
     */
    SUPPORT("未点赞",1),
    ALREADY_SUPPORT("已点赞",2),


    ;

    private String title;
    private int index;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    private InviteEnum(String title, int index) {
        this.title = title;
        this.index = index;
    }

    public InviteEnum getByIndex(int index) {
        for (InviteEnum e : InviteEnum.values()) {
            if (e.index == index) {
                return e;
            }
        }
        return null;
    }

    public InviteEnum getByTitle(String title) {
        if (null == title) {
            return null;
        }
        for (InviteEnum e : InviteEnum.values()) {
            if (e.title.equals(title)) {
                return e;
            }
        }
        return null;
    }
}
